import MySQLdb
def database_test():
  cxn = MySQLdb.connect(user='root',password='gmt123',db='blog')
  cur = cxn.cursor()
  cur.execute('select * from class')
  for data in cur.fetchall():
    print(data)

if __name__ == '__main__':
  database_test()